package com.tour.controller;


import com.tour.config.ResponseWrapper;
import com.tour.entity.Discuss;
import com.tour.entity.User;
import com.tour.service.impl.DiscussServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lel
 * @since 2020-12-30
 */
@Api(tags = "游记评论")
@RestController
@RequestMapping("/app/discuss")
public class DiscussController {


    @Autowired
    DiscussServiceImpl discussService;

    @ApiOperation("发布评论")
    @PostMapping("/addDiscuss")
    public ResponseWrapper addDiscuss(@RequestBody Discuss discuss){
        ResponseWrapper wrapper =  discussService.addDiscuss(discuss);
        return wrapper;
    }

    @ApiOperation("删除评论")
    @DeleteMapping("/deleteDiscuss")
    public ResponseWrapper deleteDiscuss(@RequestParam(name = "discussId")Integer discussId){
        ResponseWrapper wrapper = discussService.delDiscuss(discussId);
        return wrapper;
    }


}

